﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%

	dim rs,sql,i,id,classid,RepCount,viphy,gm,nid,down,readtime,phonename,pageid
Set Rs = Server.CreateObject("Adodb.Recordset")
	pageid=Request.QueryString("pageid")
	id=Request.QueryString("id")
	if id="" then id=0
	if not isnumeric(id) then id=0
	id=clng(id)
        phonenid=qingtian.phonename(midqd,1)
	if sid<>"Null" then

	Sql = "select vip,id from qingtian_user where sid='"&md5(sid) & md5(strReverse(sid))&"'"
	Rs.Open Sql,conn,1,1

	if not (rs.bof and rs.eof)  then
		viphy=rs("vip")
		nid=rs("id")
	end if
	Rs.close	

	Sql = "select id from qingtian_paym where ext=1 and listid="&id&" and  nid="&nid&""
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
		gm=1
	else
		gm=0
	end if
	Rs.close	

	set rs=nothing
	else
		viphy=0
		gm=0
	end if

	conn.execute("update qingtian_fileli set ReadCount=ReadCount+1 where id="&id&"")
                set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 *  FROM qingtian_phoneurl where aid="&id&" and (bid="&phonenid&" or bid=0) Order by id desc"
		rs.open sql,conn,1,1
                if not (rs.bof and rs.eof)  then
		fileext=rs("fileext")
		filesize=rs("filesize")
                else
                if v=0 then
                Response.Write "<card id=""add"" title=""出错了""><p align=""left"">"
                else
                Response.Write "<title>出错了</title></head><body>"
                end if
                qingtian.err("该软件下载地址不存在")
                end if
		rs.Close
		Set rs = Nothing
	Set Rs = Server.CreateObject("Adodb.Recordset")

	Sql = "select name,namet,leiid,tuurl,content,downCount,ReadCount,RepCount,[time],[readtime],VIP,zf,tuijian,viphy,vipgm from qingtian_fileli where id="&id
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
                leiid=rs("leiid")
                nameq=rs("namet")

select case v
case "0" 
ttr="<anchor><prev/>返回</anchor>"
we0="<br/>"
Randomize()
book="<input size=""15"" name=""remark"" type=""text"" maxlength=""128"" emptyok=""true"" value="""" /><br/><anchor title=""发表评论"">发表评论<go href='fileshowing.asp?id="&id&"&amp;sid="&sidd&"' method='post'><postfield name=""remark"" value=""$(remark)"" /></go></anchor><br/>"
%>
<card title="<%=qingtian.utf8(rs("name"))%>"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
ttr="<a href=""liebie.asp?page="&pageid&"&amp;listid="&leiid&"&amp;sid="&sidd&""">"&nameq&"</a>"
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
Randomize()
book="<form action=""fileshowing.asp?id="&id&"&amp;sid="&sidd&""" method=""post""><input type=""text"" name=""remark"" size=""15"" value="""" /><br/><input type=""submit"" value=""发表评论"" /></form><br/>"
ziz="<div style=""background-color:#FF5226;color:#E1E100"">"
%>
<title><%=qingtian.utf8(rs("name"))%></title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%
End Select		





		%><%
		

		if sid="Null" then
%>
                <%=ziz%><a href="login.asp?sid=<%=sidd%>&amp;url=fileli.asp?id=<%=id%>">登陆</a>|<%=qingtian.phonetol("/fileve.asp?id="&id)%><%=we0%>
<%
		else
		qingtian.info
%>
                <%=ziz%><a href="index.asp?sid=<%=sidd%>">首页</a>|<%=qingtian.phonetol("/fileve.asp?id="&id)%><%=we0%>
<%
		end if
		readtime=rs("readtime")
                tuurl=rs("tuurl")
                RepCount=rs("RepCount")	
                content=rs("content")
                if Request.QueryString("actt")<>1 then content=left(content,300)&"[url=fileve.asp?actt=1&id="&id&"&sid=[sid]].更多[/url]" 
		if rs("viphy")=1 then
			if viphy=1 then
			down=true
			else
			down=false
			end if
		elseif rs("vip")=1 and gm=0 then
				if rs("zf")=0 and sid<>"Null" then
					down=true
				else
					down=false
				end if
		else
			down=true

		end if

		%><%=qingtian.qingsav("13")%><%=we%><a href="newli.asp?id=<%=leiid%>&amp;act=1&amp;sid=<%=sidd%>">最新</a>.<a href="downli.asp?id=<%=leiid%>&amp;act=1&amp;sid=<%=sidd%>">最热</a>.<a href="tuijianli.asp?id=<%=leiid%>&amp;act=1&amp;sid=<%=sidd%>">推荐</a>.<%=ttr%><%=we0%>
		<%=dao%><b>【<%=qingtian.utf8(rs("name"))%>】</b><%=we0%>
                    <%=we%><img src="<%=tuurl%>" alt=""  noselect = "true"/><%=we0%>
<%
		if down=true  then
		%><%=sou%><a href="down.asp?id=<%=id%>&amp;sid=<%=sidd%>">免费下载软件包(<%=qingtian.utf8(filesize)%>)</a><%=we0%><%
		else
			if rs("viphy")=1 then
				if viphy=1  then
				%><%=sou%><a href="paym.asp?ext=1&amp;id=<%=id%>&amp;sid=<%=sidd%>">购买下载软件包(<%=qingtian.utf8(filesize)%>)</a><%=we0%><%
				else
				%><%=sou%>VIP会员查看软件包(<%=qingtian.utf8(filesize)%>)<%=we0%><%
				end if
			else
				if sid<>"Null" then
				%><%=sou%><a href="paym.asp?ext=1&amp;id=<%=id%>&amp;sid=<%=sidd%>">购买下载软件包(<%=qingtian.utf8(filesize)%>)</a><%=we0%><%
				else
				%><%=sou%>登陆下载软件包(<%=qingtian.utf8(filesize)%>)<%=we0%><%
				end if
			end if
		end if
		%>
		<%=we%>下载:<%=qingtian.utf8(rs("downCount"))%>,阅读<%=qingtian.utf8(rs("ReadCount"))%><%=we0%>
<%=sou%>类别:<%
		if rs("viphy")=1 then
			if rs("vip")=1 and rs("zf")>0 then%><%=qingtian.bi%>下载(<%=qingtian.utf8(rs("zf"))%>)<%=we0%><%else%>VIP会员下载<%=we0%><%end if
		else
		if rs("vip")=1 and rs("zf")>0 then%><%=qingtian.bi%>下载(<%=qingtian.utf8(rs("zf"))%>)<%=we0%><%elseif rs("vip")=1 then%>会员下载<%=we0%><%else%>免费下载<%=we0%>
<%
		end if
		end if%>
		<%=we%>简介:<%=qingtian.ubb(content)%><%=we0%>
                <%=sou%>类型:<a href="liebie.asp?listid=<%=leiid%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("namet"))%></a><%=we0%>
                <%=we%>格式:<%=qingtian.utf8(fileext)%><br/>机型:<%=qingtian.phonename(midqd,2)%><a href='/phone.asp?sid=<%=sidd%>&amp;urls=/fileve.asp?id=<%=id%>'>更改</a><%=we0%>
                <%=sou%>更新:<%=qingtian.FormatTime(rs("time"),0)%><%=we0%>


<%
		if down=true  then
		%><%=we%><a href="down.asp?id=<%=id%>&amp;sid=<%=sidd%>">免费下载软件包(<%=qingtian.utf8(filesize)%>)</a><%=we0%><%
		else
			if rs("viphy")=1 then
				if viphy=1  then
				%><%=we%><a href="paym.asp?ext=1&amp;id=<%=id%>&amp;sid=<%=sidd%>">购买下载软件包(<%=qingtian.utf8(filesize)%>)</a><%=we0%><%
				else
				%><%=we%>VIP会员查看软件包(<%=qingtian.utf8(filesize)%>)<%=we0%><%
				end if
			else
				if sid<>"Null" then
				%><%=we%><a href="paym.asp?ext=1&amp;id=<%=id%>&amp;sid=<%=sidd%>">购买下载软件包(<%=qingtian.utf8(filesize)%>)</a><%=we0%><%
				else
				%><%=we%>登陆下载软件包(<%=qingtian.utf8(filesize)%>)<%=we0%><%
				end if
			end if
		end if
		%><%=hr%>

			<%=sou%>评论该软件:<%=we0%>
			<%=book%>
		<%
	else
	 Response.Redirect"index.asp?sid="&sidd&""
		classid=0
	end if
	Rs.close	



            If DateDiff("m", readtime, Now()) > 0 Then
                conn.execute("update qingtian_fileli set [Monthread]=1,[readtime]='" & Now() & "' where [id]=" & id & "")
            Else
                conn.execute("update qingtian_fileli set [Monthread]=[Monthread]+1,[readtime]='" & Now() & "' where [id]=" & id & "")
            End If

            If DateDiff("ww", readtime, Now()) > 0 Then
                conn.execute("update qingtian_fileli set [Weekread]=1 where [id]=" & id & "")
            Else
                conn.execute("update qingtian_fileli set [Weekread]=[Weekread]+1 where [id]=" & id & "")
            End If

            If DateDiff("d", readtime, Now()) > 0 Then
                conn.execute("update qingtian_fileli set [Dayread]=1 where [id]=" & id & "")
            Else
                conn.execute("update qingtian_fileli set [Dayread]=[Dayread]+1 where [id]=" & id & "")
            End If





	Sql = "select top 3 id,content,user,uid from qingtian_file_reply where  listid="&id&"  order by id desc"

	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
	For i=1 to rs.RecordCount
		dat=RepCount+1-i
dat1=dat mod 2
if dat1=0 then
%>


		<%=we%><%=zi%><%=dat%>楼.<%=zi0%>[<%=qingtian.utf8(rs("user"))%>]说:<%=qingtian.ubb(rs("content"))%><%=we0%>
<%
else
%>
<%=sou%><%=zi%><%=dat%>楼.<%=zi0%>[<%=qingtian.utf8(rs("user"))%>]说:<%=qingtian.ubb(rs("content"))%><%=we0%>




<%
                End If
	Rs.MoveNext
	next
	end if
	Rs.close	
	
	%>
		<%=we%><a href="fileshowinglist.asp?infoid=<%=id%>&amp;sid=<%=sidd%>">查看网友评论(<%=RepCount%>条)</a><%=we0%>
	<%

        Sql = "select top 1 a.id,a.name FROM qingtian_fileli a,qingtian_phoneurl b WHERE a.leiid="&leiid&" and a.id<"&id&" and b.aid=a.id and (b.bid="&phonenid&" or b.bid=0) order by a.id desc"

	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
			%><%=sou%>下一个<a href="fileve.asp?pageid=<%=pageid%>&amp;id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a><%=we0%><%
	end if
	Rs.close	



	  Sql = "select top 1 a.id,a.name FROM qingtian_fileli a,qingtian_phoneurl b WHERE a.leiid="&leiid&" and a.id>"&id&" and b.aid=a.id and (b.bid="&phonenid&" or b.bid=0) order by a.id asc"

	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
			%><%=sou%>上一个<a href="fileve.asp?pageid=<%=pageid%>&amp;id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a><%=we0%><%
	end if
	Rs.close
%>	
<%=qingtian.qingsav("14")%>
<%=we%><a href="liebie.asp?page=<%=pageid%>&amp;listid=<%=leiid%>&amp;sid=<%=sidd%>">返回<%=nameq%></a><%=we0%>
<%
		set rs=nothing

%>

<%
end Function
%>
